import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import { apiUrl } from "./src/util/static";

// https://vitejs.dev/config/
export default defineConfig({
  css: {
    preprocessorOptions: {
      scss: {
        api: "modern-compiler",
        silenceDeprecations: ['legacy-js-api'],
      }
    }
  },
  plugins: [uni()],
  server: {
    proxy: {
      "/file": {
        target: apiUrl, //目标域名
        changeOrigin: true, //需要代理跨域
        secure: false,
      },
    },
    host: true,
    strictPort: false,
    open: false,
  }
});
